﻿@model IEnumerable<FlyingClub.Models.Member>

@{
    ViewBag.Title = "Administration des membres";
}

<h1>@ViewBag.Title</h1>

<div class="link-button">
    <a href="/Members/Create#admin">Ajouter un nouveau membre</a>
</div>
<div></div>

<table class="members-tab">
    <tbody>
        <tr>
            <td>NOM Prénom</td>
            <td>Courriel</td>
            <td>Sexe</td>
            <td>Adhésion</td>
            <td>Cotisation</td>
            <td>Crédit</td>
            <td>Staff</td>
            <td>I-Numer</td>
            <td></td>
        </tr>
@foreach (var item in Model)
{
        <tr>
            <td><a href="Details/@item.ID#admin">@Html.DisplayFor(modelItem => item.Lastname).ToString().ToUpper() @Html.DisplayFor(modelItem => item.Firstname)</a></td>
            @if (item.ID != 1)
            { 
                <td>@item.Email</td>
                <td>
                    @if (item.Gender == true)
                    {
                        <span>♂</span>
                    }
                    else
                    {
                        <span>♀</span>
                    }
                </td>
                <td>@item.AdhesionDate.ToString("dd/MM/yyyy")</td>
                <td>@item.AdhesionFees.ToString("dd/MM/yyyy")</td>
            }
            else
            { 
                @:<td>&nbsp;</td><td>&nbsp</td><td>&nbsp;</td><td>&nbsp;</td>
            }
            <td>@Html.DisplayFor(modelItem => item.Wallet)</td>
            @if (item.ID != 1)
            { 
                <td>@Html.DisplayFor(modelItem => item.Staff)</td>
                <td>@Html.DisplayFor(modelItem => item.InstructorNumber)</td>
                <td><a href="/Members/Delete/@item.ID#admin"><img src="@Url.Content("~/Content/images/remove.png")" alt="Supprimer" /></a></td>
            }
            else
            {
                @:<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
            }
        </tr>
}
    </tbody>
</table>